import 'package:froom/froom.dart';
import 'package:get/get.dart';
import "../../lib/src/type_converter.dart";

// ignore: uri_has_not_been_generated
part 'product.g.dart';

/// 产品实体 - 测试用
@Entity(tableName: 'products')
class Product {
  @PrimaryKey(autoGenerate: true)
  final int? id;

  final String name;

  final String description;

  final double price;

  @ColumnInfo(name: 'category_id')
  final int categoryId;

  @ColumnInfo(name: 'is_active')
  final bool isActive;

  final String? tags; // JSON array as string

  @ColumnInfo(name: 'created_at')
  final DateTime? createdAt;

  const Product({
    this.id,
    required this.name,
    required this.description,
    required this.price,
    required this.categoryId,
    this.isActive = true,
    this.tags,
    this.createdAt,
  });
}
